<?php

namespace App\Http\Controllers\Api\V1;

use Carbon\Carbon;
use App\Models\ProductLink;
use Illuminate\Support\Facades\Redis;
use App\Http\Controllers\Api\V1\Resources\BoxCatrgroyResource;
use Rainsens\Dinglog\Facades\Dinglog;
use Illuminate\Support\Facades\DB;

class LinksController extends Controller
{
    public function store()
    {
        $link = request('link');
        $user = request()->user();
        $user->productLinks()->create(['link'=>$link]);

        return response(null, 204);
    }

     public function config()
    {
        /**
         * @var User $user
         */
        $config=[
             'rank_banner'=>img_path(cs()->serve_qrcode),
              'rank_produce_image'=>img_path(cs()->produce_image)
        ]; 
         return response()->json($config);
    }

}
